//
//  NetworkTool.h
//  AFNPackage
//
//  Created by Zhu Jinxin on 16/7/21.
//  Copyright © 2016年 Zhu Jinxin. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetworking/AFNetworking.h"

typedef NS_ENUM(NSInteger,requestType){
    
GET,
POST
    
};

@interface NetworkTool : AFHTTPSessionManager

+ (instancetype)sharedTools;

- (void)requestWith:(requestType)type urlString:(NSString*)urlString parameters:(id)parameters success:(void(^)(id responseObject))successBlock failure:(void(^)(NSError*error))failureBlock;



/**
 *  [self GET:urlString parameters:parameters progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
 success(responseObject);
 } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
 failure(error);
 }];
 */

@end
